<fieldset class="layui-elem-field">
  <legend>订单信息</legend>
  <div class="layui-field-box">
    <p>
    <div class="layui-btn-group">
    <if condition="$info.order_status eq 1">
        <button class="layui-btn layui-btn-danger layui-btn-mini cancel">取消订单</button>
    </if>
    <if condition="$info.order_status eq 2 or $info.order_status eq 0">
       <button class="layui-btn layui-btn-mini sure">确认订单</button>
    </if>
    </div>
    </p>
    <p>下单日期:{$info['add_time']|date='Y年m月d日 H:i:s',###} &nbsp;&nbsp; 付款日期:{$info['pay_time']|date='Y年m月d日 H:i:s',###}</p>
    <p>下单店铺:{$info['depart_name']|default='线上订单'} &nbsp;&nbsp; 销售导购:{$info['staff_name']|default='系统销售'}</p>
    <p>单号:{$info['order_sn']} &nbsp;&nbsp; 收货人:{$info['consignee']} &nbsp;&nbsp; 购货人:{$info['nick_name']}({$info['user_name']})</p>
    <p>收货地址:{$info['provincename']}{$info['cityname']}{$info['districtname']}{$info['address']} &nbsp;&nbsp; 电话:{$info['tel']}</p>
    <table class="layui-table">
    <thead>
    <tr>
    <th>图片</th>
    <th>商品</th>
    <th>款号</th>
    <th>属性</th>
    <th>购买/发货</th>
    <th>价格</th>
    <th>取货方式</th>
    </tr>
    </thead>
    <tbody>
        <volist name="list" id="vo">
        <tr>
            <td> <img src="__OSS__/{$vo.goods_img}" alt="" width="80px" height="80px"/> </td>
            <td>{$vo.goods_name}</td>
            <td>{$vo.goods_sn}</td>
            <td>{$vo.goods_attr}</td>
            <td>{$vo.goods_number}/{$vo.send_number}</td>
            <td>{$vo.goods_price}</td>
            <td><if condition="$vo.get_way eq 1">店铺取货<else/>邮寄</if></td>
        </tr>
        </volist>
    </tbody>
    <table>
     <p>订单金额:{$info['goods_amount']} &nbsp;&nbsp; 订单状态:{$info.order_status|getOrderStatus=###,3},{$info.shipping_status|getOrderStatus=###,1},{$info.distribute_status|getOrderStatus=###,2}</p>
     <p>付款方式:<i style="color:red;">余额:{$info['surplus']} + 爵币:{$info['integral']} + 微信:{$info['money_paid']} + 线下:{$info['offline_pay']} + 用券:{$info['quan']}</i></p>
     <p>订单轨迹</p>
     <volist name="action" id="vo">
     <p>{$vo.log_time|date='Y-m-d H:i:s',###} &nbsp;&nbsp; {$vo.action_user} &nbsp;&nbsp; {$vo.action_note}</p>
     </volist>
  </div>
</fieldset>
<script>
layui.use(['laypage','layer','form','laydate'], function() {
    var form = layui.form(),laypage = layui.laypage,
    $ = layui.jquery;
    var oid = {$info.order_id};
    $('.cancel').click(function(){
        var url = "{:U('Bill/cancel')}";
        $.post(url,{id:oid},function(data){
        if(data.status == 'error'){
            layer.msg(data.msg,{icon: 5});
            return;
        }
        location.reload();
	})
    });
})
</script>